<%@page import="com.tqz.dao.NewsSerch_army"%>
<%@page import="com.tqz.model.Article"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/army.css">
<title>军事新闻</title>
</head>
<body>
	<div id="head">
		<div class="logo">
			<img src="picture/logo.png">
		</div>
		<div class="title">
			<span>知天下</span>
		</div>
		<c:if test="${ username == null }">
			<div class="login">
			<a href="<%=request.getContextPath()%>/adminlogin.jsp">管理员登陆</a>
		</div>
		</c:if>
		<c:if test="${ username != null }">
			<div class="login">
			<a href="<%=request.getContextPath()%>/loginsuccess.jsp">当前用户：admin</a>
		</div>
		</c:if>
	</div>
	<div id="nav">
		<div class="navblock">
			<ul>
				<li><a href="<%=request.getContextPath()%>/newshome.jsp"
					class="home">首页</a></li>
				<li><a href="<%=request.getContextPath()%>/incountry.jsp"
					class="incountry">国内</a></li>
				<li><a href="<%=request.getContextPath()%>/outcountry.jsp"
					class="outcountry">国际</a></li>
				<li><a href="<%=request.getContextPath()%>/society.jsp"
					class="society">社会</a></li>
				<li><a href="<%=request.getContextPath()%>/army.jsp"
					class="army">军事</a></li>
				<li><a href="<%=request.getContextPath()%>/tech.jsp"
					class="tech">科技</a></li>
				<li><a href="<%=request.getContextPath()%>/sports.jsp"
					class="sports">体育</a></li>
				<li><a href="<%=request.getContextPath()%>/entertainment.jsp"
					class="entertainment">娱乐</a></li>
			</ul>
		</div>
	</div>
	<div id="mainbody">
		<%
			NewsSerch_army newsSerch = new NewsSerch_army();
			List<Article> list = newsSerch.getAllArticles();
			request.setAttribute("result", list);
			request.setAttribute("className", "NewsSerch_army");
		%>
	<c:forEach items="${ result }" var="article">
			<!-- 类型自动强转 -->
			<div class="infoframe">
				<div class="infobody">   
					<h2>
						<a href="<%=request.getContextPath()%>/newsdetail.jsp?id=${ article.getId() }&className=NewsSerch_outcountry">
						<c:out value="${ article.getTitle() }"></c:out>
						</a>
					</h2>
				</div>
			</div>
		</c:forEach>
	</div>	
	<div id="bottom">
		<div class="text">Copyright ©2018-2018 ZTX</div>
	</div>
</body>
</html>
